<template>
	<view class="content container">
		<view class="list">
			<view class="list-item">
				<text>真实姓名</text>
				<input v-model="form.real_name" />
			</view>
			<view class="list-item">
				<text>银行卡号</text>
				<input v-model="form.bank_number" placeholder-class="placeholder" placeholder="请输入卡号" />
			</view>
			<view class="list-item">
				<text>预留手机</text>
				<input v-model="form.mobile" placeholder-class="placeholder" placeholder="请输入银行预留手机号" />
			</view>
		</view>
		<view class="desc">
			<view class="label"><text>温馨提示:</text></view>
			<view><text>请绑定银行“一类卡”卡号，请勿绑定任何银行界定的二类卡、网商银行、虚拟卡号等，可能会导致付款、收款不成功!</text></view>
		</view>
		<button class="btn" @click="bindBank">确认绑定</button>
		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {},
				enable: true,
			}
		},
		created() {
			
		},
		methods: {
			bindBank() {
				if (!this.enable) return
				this.enable = false
				this.$http.post('user/bindBank', this.form).then(res => {
					this.$refs.uToast.show({
						message: res.msg, 
						complete: () => {
							this.back()
						}
					})
				}).catch(() => {
					this.enable = true
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.content.container {
	overflow: hidden;
	height: 100vh;
	background: #f7f7f7;
	
	
	.list {
		margin: 40rpx;
		.list-item {
			border-radius: 20rpx;
			background: #fff;
			margin-bottom: 40rpx;
			padding: 40rpx;
			display: flex;
			align-items: center;
			
			> text {
				color: #999;
				font-size: 28rpx;
			}
			
			> input {
				border: 0;
				flex: 1;
				margin-left: 30rpx;
				font-size: 28rpx;
				.placeholder {
					color: #222;
					font-size: 28rpx;
				}
			}
			
			/* > view {
				font-size: 28rpx;
				line-height: 1.35;
				&:first-child {
					margin-bottom: 16rpx;
				}
			} */
			
		}
	}
	
	.desc {
		margin: 0 40rpx 40rpx 40rpx;
		
		.label {
			margin-bottom: 20rpx;
		}
		
		text {
			font-size: 28rpx;
			color: #222;
		}
	}
	
	.btn {
		margin: 0 40rpx;
		font-size: 28rpx;
		border-radius: 40rpx;
		background: rgba(1,106,250,1);
		color: #fff;
		line-height: 80rpx;
	}
}
</style>
